<div class="vote">
<% if !@random_posts.nil? %>
  <ul>
    <li class="polaroid first"><%= image_tag @random_posts.first.image(:medium) %></li>
      <% if !@user_voted_post_id.include?(@random_posts.first.id) %>
        <li><%= link_to "Vote", votes_path(:post_id => @random_posts.last.id), :method => :post, :class => "orange-btn" %></li>
      <% else %>
        <li><%= link_to "Reload", votes_path, :method => :post %></li>
        <li>You have already voted for this post!!</li>
      <% end %>
  </ul>

  <ul>
    <li class="polaroid last"><%= image_tag @random_posts.last.image(:medium) %></li>
        <% if !@user_voted_post_id.include?(@random_posts.first.id) %>
          <li><%= link_to "Vote", votes_path(:post_id => @random_posts.last.id), :method => :post, :class => "yellow-btn" %></li>
        <% else %>
          <li><%= link_to "Reload", votes_path, :method => :post %></li>
          <li>You have already voted for this post!!</li>
        <% end %>
  </ul>
<% else %>
  <h1>You have voted on every post!!!!</h1>
<% end %>
</div>


